Skip to content

fix: catch exceptions in ChonkBatchVerifier::batch_check for corrupted proofs#22278

Closed
AztecBot wants to merge 1 commit intomerge-train/barretenbergfrom
claudebox/fix-serialize-hpp-ub
Closed

fix: catch exceptions in ChonkBatchVerifier::batch_check for corrupted proofs#22278
AztecBot wants to merge 1 commit intomerge-train/barretenbergfrom
claudebox/fix-serialize-hpp-ub

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

@AztecBot AztecBot commented Apr 2, 2026

Summary

PR #22263 replaced BB_ASSERT(val.on_curve()) with throw_or_abort in field_conversion.hpp. Unlike BB_ASSERT, throw_or_abort is not gated by BB_DISABLE_ASSERTS(), so corrupted IPA proof data now throws std::runtime_error during deserialization in batch_check(). This crashed ChonkBatchVerifierTests.RandomMixedBatches which relies on graceful failure handling for tampered proofs.

Wrapped batch_reduce_verify in try-catch so exceptions trigger bisection (isolating the bad proof) instead of crashing. This matches the existing exception handling in parallel_reduce().

Detailed analysis: https://gist.github.com/AztecBot/77137fb49556386b149db99b4f2f3e55

Test plan

  • ChonkBatchVerifierTests.RandomMixedBatches passes
  • All 29 chonk_tests pass
  • ./bootstrap.sh ci — all 6148 tests pass

ClaudeBox log: https://claudebox.work/s/2f534a3f42ce7803?run=1

…d proofs

PR #22263 replaced BB_ASSERT(val.on_curve()) with throw_or_abort in
field_conversion.hpp. Unlike BB_ASSERT, throw_or_abort is not gated by
BB_DISABLE_ASSERTS(), so corrupted IPA proof data now throws
std::runtime_error during deserialization in batch_check(). This
crashed ChonkBatchVerifierTests.RandomMixedBatches which relies on
graceful failure handling for tampered proofs.

Wrap batch_reduce_verify in try-catch so exceptions trigger bisection
(isolating the bad proof) instead of crashing.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Apr 2, 2026
Copy link
Copy Markdown
Collaborator

@ludamad ludamad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not spoil the whole batch.

@AztecBot
Copy link
Copy Markdown
Collaborator Author

AztecBot commented Apr 8, 2026

Automatically closing this stale claudebox draft PR (no updates for 5+ days). Re-open if still needed.

@AztecBot AztecBot closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants